home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / utilities / file / randomcopy0_91.lha / RandomCopy / randomcopy.doc next >
Encoding:
Text File  |  1994-11-21  |  7.3 KB  |  189 lines

  1.  
  2.  
  3.                              Randomcopy V0.91
  4.  
  5. 1.  Disclaimer.  READ FIRST!
  6.  
  7.     The  author of this program, randomcopy, cannot be held responsible for
  8. any  damage  caused,  either direct or indirect, to any files, programs, or
  9. hardware  resulting from proper,improper, or normal usage.  Use at your own
  10. risk.
  11.  
  12.     Randomcopy,  including  all executables and source, is ® Copyright 1993
  13. by  Chad Randall and mbissaymssik software.  This program is not shareware,
  14. but  is  FREEWARE.   You  needn't pay a dime to use, it's free.  This means
  15. it's  free  to everyone, and you may not charge any money for it (sell it).
  16. This  right  is  reserved  by  the  author.  You may, of course, charge for
  17. duplication   fees,   storage   media,  or  shipping  charges.   Commercial
  18. distribution  is prohibited.  If you feel you company would like to include
  19. this file with your product, you may contact the author.
  20.  
  21.  
  22. 2.  Copyright notice.
  23.  
  24.     Once again, this program, including all binaries, text, and source is;
  25.  
  26.         ® Copyright 1993,94 by Chad Randall and mbissaymssik software.
  27.  
  28.                           All rights reserved.
  29.  
  30.  
  31. 3.  Introduction
  32.  
  33.     Workbench  2.x  or  higher  is required.  If you do not have 2.x yet, I
  34. strongly  suggest  you  run out and get it.  Or better, get an A1200.  It's
  35. quite nice.
  36.  
  37.     Randomcopy is a small CLI interface run command.  It accepts a wildcard
  38. pattern for a source and a filename for a destination.  Example:
  39.  
  40. randomcopy   FROM   PREFS:presets/patterns/#?   TO  env:sys/wbpattern.prefs
  41.  
  42.     Randomcopy  will  scan  the directory at PREFS:presets/patterns for any
  43. files.    It  will  choose  one  at  random  and  copy  it  into  the  file
  44. env:sys/wbpattern.prefs.
  45.  
  46.  
  47. 4.  Why use it?
  48.  
  49.     I  had  a bunch of workbench backdrop pictures on my 1200 and wanted to
  50. be able to have one choosen at random at bootup.  I thought of many ways of
  51. doing  it.   I  believed  others might want random pointers, palettes, etc.
  52. Then  I  thought  that  there  might  be  other  usages for it too (send me
  53. ideas!).
  54.     Of course, the main reason I can see to use it is to have a random pref
  55. file each time you reboot.  This is the main reason to use it as of now.
  56.  
  57.     An  AREXX  script  could  probably  be written to do basically the same
  58. function  as this program.  But isn't it easier just to download this small
  59. file from Aminet?  And how many people *really* know AREXX?  I don't..
  60.  
  61.  
  62. 5.  Usage
  63.  
  64.     To  run  the  program, it must be done from the CLI.  No wbinterface is
  65. included.   It  has to be given a minimum of two parameters, similar to the
  66. CLI COPY command.
  67.  
  68. randomcopy FROM,TO,MINWAIT,MAXWAIT,USETICKS,LONGBREAK,QUIET,CLONE,NOREQ,
  69.            BUFFER,RNDFILE,ABOUT
  70.  
  71.     The  FROM keyword is optional.  If it isn't present, the first argument
  72. encountered will be the source.  Same with the TO keyword.
  73.  
  74.     The  sourcepattern (FROM) argument is just that, a pattern.  Of course,
  75. this  might  be  a filename.  A filename is a pattern, but of course, there
  76. will be no randomness about it.  It will happily copy the file.
  77.  
  78.     The  destination argument must include a filename.  You can't copy to a
  79. directory  name  or a pattern.  Only a file.  This may be changed in future
  80. releases.
  81.  
  82.     The  MINWAIT  is the minimum amout of time to wait.  If the USETICKS is
  83. not present, than this is in seconds.
  84.  
  85.     The  MAXWAIT  is the maximum amout of time to wait.  If the USETICKS is
  86. not present, than this is in seconds.
  87.  
  88.     If  only one WAIT statement is present, than basically the program will
  89. wait  a specified time.  Otherwise, a random time is picked between the MIN
  90. and MAX.
  91.  
  92.     The  USETICKS switch specifies that the MINWAIT and MAXWAIT amounts are
  93. specified  in clock ticks.  This is stated as be 50 ticks per second in the
  94. RKM's.   This  may  be  60  per NTSC (vblank), so adjust accordingly.  I've
  95. tested the waits and they seem fairly accurate.
  96.  
  97.     The  LONGBREAK  switch specifies that you wish the program to use sleep
  98. the  entire  time it is waiting.  If this switch is not specified, than the
  99. randomcopy  checks  for  a  break (ctrl-c) signal every 100 ticks.  If this
  100. switch  is  ON  then you may not break to program until a wait is finished.
  101. If  you  wait  is 15 minutes, then you must wait the entire time.  Use with
  102. care.
  103.  
  104.     The  QUIET  switch  supresses  any  console output.  This is useful for
  105. scripts,  mainly  the  startup-sequence.   This  should  suppress ALL text,
  106. unlike earlier versions which seemed to carry some debug stuff.  Opps.
  107.  
  108.     The  NOREQ  switch  is  not  implemented  as  of  yet, and is basically
  109. ignored.
  110.  
  111.     The  ABOUT switch will print (if QUIET is not present) some information
  112. about  the  program,  and  will  give some addresses.  Note that randomcopy
  113. still needs a source and destination.
  114.  
  115.     The  RNDFILE  switch  will retrieve a seed from the S:  directory,
  116. and  then  save  it back out.  This is only really needed if you don't
  117. have an internal clock to generate seeds.
  118.  
  119.     The  file  includes a $VER string, which can use the command version to
  120. read.  All 2.x programs and libraries should carry this.  Listen up!
  121.  
  122. 6.  Examples
  123.  
  124.     Having  a  directory  full of small text files, each containing a small
  125. fortune cookie message.  Just use:
  126.  
  127. randomcopy cookies:#?.txt ram:yourfortune
  128. type ram:yourfortune
  129.  
  130.     This  will  copy  a  file  from a list of matching filenames to the RAM
  131. drive.  Then the message is printed to the console window.
  132.  
  133.     But for a more impressive result:
  134.   
  135. randomcopy pictures:(#?man#?|#?dog#?) ram:showme.pic
  136. viewpic ram:showme.pic
  137. delete ram:showme.pic
  138.  
  139.     This will select a pic with either "man" or "dog" in it's name from the
  140. directory  pictures.   Then  of course, the selected picuture is displayed.
  141. And finally the picture is deleted.
  142.  
  143.     When  you  run  workbench,  usually  (hopefully), a small daemon called
  144. IPrefs  is run also.  This program checks for alterations to any preference
  145. file  stored  in  ENV:.   You  could  then  run this program at any time to
  146. randomly  copy  a  file  from  a set of presets into it's matching env:sys/
  147. counterpart and have the modifications take place automatically.  Include a
  148. oneliner in the shell-startup script, and every time a new shell starts you
  149. could have your window patterns or your pointer change.
  150.  
  151. 7.  Tips
  152.  
  153.     Of  course,  you  would  not  want to copy an .info file.  Just use the
  154. power of OS 2.x pattern matching:
  155.  
  156. randomcopy PREFS:presets/patterns/#?~(#?.info) ENV:sys/wbpattern.prefs
  157.  
  158.     This  will  exclude any info files, so you could still use workbench to
  159. move, modify, or update your preset settings.
  160.  
  161.     Use your imagination!
  162.  
  163.  
  164. 8.  Contacts for info or bug reports.
  165.  
  166.     This  is  my  first  semi-finished project.  Of course it is one of the
  167. smaller ones, too.  But I'm sure there are many bugs still in the code.
  168.  
  169.     You can send me EMail at crandall@garnet.msen.com
  170.  
  171.     I  would  really  appreciate any comments; good, bad or the ugly.  Even
  172. flames.
  173.  
  174.     If  you  live  in  timbuktu  and don't have Internet access (poor, poor
  175. thing.)  you  can  send USNAIL to me at 229 S.Washington St, Manchester, MI
  176. 48158-9680.  This is in the US of course.
  177.  
  178.  
  179. 9.  Plans, notes, and bugs.
  180.  
  181.     There  are  many  things I can do to this program given some more time.
  182. This includes:
  183.  
  184.   o Activating the NOREQ feature.  Any suggestions how would be nice.
  185.     Do I change my process window pointer to -1, or do I search the 
  186.     device list?  How do I go about either???  Help.
  187.  
  188.   o Are there any bugs to be fixed?
  189.